Visual Cafe Pro Language Reference Exception index | Bottom

SQL exceptions

Description A method throws a SQL exception when a problem with a database or dbANYWHERE Server occurs.
Hierarchy java.lang.Object
|
+----java.lang.Throwable
|
+----java.lang.Exception
|
+----symjava.sql.SQLException
|
+----symjava.sql.SQLConnectionException
|
+----symjava.sql.SQLServerConnException

Exception Index

Top | Bottom
SQLConnectionException
 o Indicates that a database connection failed.
SQLException
 o Indicates that a dbANYWHERE Server operation failed.
SQLServerConnException
 o Indicates that a socket connection to a dbANYWHERE Server is broken.

Exceptions

Exception index | Top | Bottom

Class: symjava.sql.SQLConnectionException

Purpose Indicates that a database connection failed.
Description A method throws a SQLConnectionException when a database connection fails. The most likely causes for such a failure are:
 o Invalid user name.
 o Invalid password.

Any attempts to use the RelationView will fail.

When a dbANYWHERE Server catches a SQLConnectionException:

  1. If the object implementing the Logon interface registered itself with the Session's LogonHandler, then the dbANYWHERE Server calls logonFailed. Based on logonFailed's return value, the dbANYWHERE Server does one of the following:
     o If logonFailed returns True (which means that the user changed the user name and/or password), the dbANYWHERE Server tries to create the view again. The process (SQLConnectionException/logonFailed) repeats until the dbANYWHERE Server successfully recreates the view.
     o If logonFailed returns False (which means that the user canceled the operation), the dbANYWHERE Server rethrows SQLConnectionException.
  2. If the object implementing the Logon interface didn't register itself with the Session's LogonHandler, then the dbANYWHERE Server rethrows SQLConnectionException.

To handle a SQLConnectionException

  1. Catch the SQLConnectionException.
  2. If the object implementing the Logon interface registered itself with the Session's LogonHandler, let the dbANYWHERE Server handle the exception.
  3. If the object implementing the Logon interface didn't register itself with the Session's LogonHandler or if the dbANYWHERE Server rethrows the exception, do one of the following:
     o Terminate or restart the applet or application.
     o Invoke a method that handles this exception. (You need to create this method.)

Class: symjava.sql.SQLException

Purpose Indicates that a dbANYWHERE Server operation failed.
Description A method throws a SQLException when a dbANYWHERE Server operation fails. If the exception is not a SQLConnectionException or SQLServerConnException, the next operation has a reasonable chance of succeeding.

To handle a SQLConnectionException that is not a SQLConnectionException or SQLServerConnException

  1. Catch the SQLException.
  2. Invoke a method that handles this exception. (You need to create this method.)

Class: symjava.sql.SQLServerConnException

Purpose Indicates that a socket connection to a dbANYWHERE Server is broken.
Description A method throws a SQLServerConnException when the socket connection to a dbANYWHERE Server is broken. Any attempts to use the dbANYWHERE Server will fail.

To handle a SQLServerConnException

  1. Catch the SQLServerConnException.
  2. Terminate or restart the applet or application.

Exception index | Top

Copyright © 1996 Symantec Corporation. All rights reserved.